/**
 * Created by lighter on 2014/12/20.
 */
package Hxw3DEngine.asset.parsers.bson.vo {
public class MaterialTexture extends MaterialBase {

    public var diffuse_texture:uint;
    public var normal_texture:uint;
    public var specular_texture:uint;

    public var both_side:Boolean;
    public var repeat:Boolean;

    public var alpha_blending:Boolean;
    public var alpha_mode:uint;
    public var alpha_threshold:Number;

    public var mipmap:Boolean;
    public var smooth:Boolean;

    public var alpha_premultiplied:Boolean;

    public function MaterialTexture(obj:Object) {
        super(obj);

        diffuse_texture = obj.hasOwnProperty("diffuse_texture")?obj.diffuse_texture:uint(-1);
        normal_texture = obj.hasOwnProperty("normal_texture")?obj.normal_texture:uint(-1);
        specular_texture = obj.hasOwnProperty("specular_texture")?obj.specular_texture:uint(-1);

        both_side = obj.hasOwnProperty("both_side")?obj.both_side:false;
        repeat = obj.hasOwnProperty("repeat")?obj.repeat:false;

        alpha_blending = obj.hasOwnProperty("alpha_blending")?obj.alpha_blending:false;
        alpha_mode = obj.hasOwnProperty("alpha_mode")?obj.alpha_mode:0;
        alpha_threshold = obj.hasOwnProperty("alpha_threshold")?obj.alpha_threshold:0;

        mipmap = obj.hasOwnProperty("mipmap")?obj.mipmap:true;
        smooth = obj.hasOwnProperty("smooth")?obj.smooth:true;

        alpha_premultiplied = obj.hasOwnProperty("alpha_premultiplied")?obj.alpha_premultiplied:false;
    }
    override protected function getObject(obj:Object):Object{
        super.getObject(obj);
        obj.diffuse_texture = diffuse_texture;
        obj.normal_texture = normal_texture;
        obj.specular_texture = specular_texture;

        obj.both_side = both_side;
        obj.repeat = repeat;

        obj.alpha_blending = alpha_blending;
        obj.alpha_mode = alpha_mode;
        obj.alpha_threshold = alpha_threshold;

        obj.mipmap = mipmap;
        obj.alpha_premultiplied = alpha_premultiplied;
        return obj;
    }
}
}
